/**
 * 历史版本信息 引用JS文件
 */

//初始化页面加载
$(function(){
	pageList(1);
});

function pageList(){
	
	$.ajax({
		url : "../self/versionInfo",
		type : "post",
		dataType : "json",
		data : {"uniqueCode":uniqueCode},
		success : function(data){
			
			console.log(data);
			
			if(data == null || data == -1){
				return;
			}
			
			$("#sp_org").html(data.obj.OWNER_DEPTNAME);
			$("#sp_name").html(data.obj.PERSON_LIABLE_NAME);
			$("#sp_time").html(okrTime(data.obj.O_YEAR,data.obj.O_QUARTER,data.obj.O_MONTH));
			$("#sp_code").html(data.obj.O_CODE);
			
			if(data.version.length == 0){
				$("#list").html('<div class="mui-card" style=""><div class="mui-card-footer"><p class="index-status" style="text-align:center; width:100%;margin-top:3%;">暂无信息</p></center></div>');
				return;
			}
			
			$("#list").html("");
			var str = "";  
			$.each(data.version,function(n,value) {
				str += '<div class="mui-card" style="">';
				str += '<a href="versiond?orgCode='+orgCode+'&memberCode='+memberCode+'&uniqueCode='+uniqueCode+'&versionUuid='+value.O_VERSION_UUID+'">';
				str += '<div class="mui-card-footer">';
				str += '<span class="index-status">版本号：<span class="cblue">'+value.VERSION_CODE+'</span></span>';
				str += '<span>审核人：<span class="">'+value.VERIFICATION_OVER_PERSO_NNAME+'</span></span>';
				str += '</div>';
				str += '<div class="mui-card-footer">';
				str += '<span class="index-status">审核通过日期：<span class="cblue">'+getTime(value.VERIFICATION_OVER_TIME)+'</span></span>';
				str += '</div>';
				str += '<div class="mui-card-footer">';
				str += '<span class="index-status">变更原因：<span class="">'+value.OKR_CHANGE_REASON+'</span></span>';
				str += '</div>';
				str += '</a>';
				str += '</div>';
			});  
			
			$("#list").html(str);
		}
	});
}